{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=357
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,j,n,m:longint;
	a:array[0..1010,0..1010] of longint;
	ansV,ansR,ansC:int64;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
fillchar(a,sizeof(a),0);
read(n,m);
for i:=1 to n do
	for j:=1 to m do read(a[i][j]);
ansV:=-1;
ansR:=-1;
ansC:=-1;
for i:=1 to n do begin
	for j:=1 to m do
		if a[i][j]>ansV then begin	
			ansR:=i;
			ansC:=j;
			ansV:=a[i][j];
		end;
end;
writeln(ansV);
write(ansR-1,' ',ansC-1);
end.